/*
 * VsForegroundDetector.cpp
 *
 *  Created on: Mar 27, 2013
 *      Author: andre
 */

#include "VsForegroundDetector.h"
#include "VsMotionDetector.h"
#include "VsObjectDetector.h"

VsForegroundDetector::VsForegroundDetector(VsForegroundConfig *config)
{
	this->config = config;

	if(config->motionConfig.enabled)
		this->objDetector.push_back(new VsMotionDetector(&config->motionConfig));

	foregroundImg = objDetector[0]->foregroundImg;
}

VsForegroundDetector::~VsForegroundDetector()
{
	for(int i=0;i<(int)objDetector.size();i++)
		delete objDetector[i];

	objDetector.clear();
	printf("Deletando ForegroundDetector\n");
}

int VsForegroundDetector::process(IplImage *inputImg)
{
	static int i;

	for(i=0;i<(int)objDetector.size();i++)
		objDetector[i]->process(inputImg);

	return 0;
}



